app.service('csService', function ($http) {

    //初始化数据选课
    this.initData = function () {
        return $http.get('../user/findUserId.do');
    }
    //读取已选的课
    this.getCSs = function (uid) {
        return $http.get('../cs/getCSs.do?uid=' + uid);
    }
    //读取未选的课
    this.getNoCss = function (uid) {
        return $http.get('../cs/getNoCss.do?uid=' + uid);
    }
    //选课
    this.addCSs = function (cid, uid) {
        return $http.get('../cs/addCSs.do?cid=' + cid + '&uid=' + uid);
    }
    //退课
    this.quitCSs = function (cid, uid) {
        return $http.get('../cs/quitCSs.do?cid=' + cid + '&uid=' + uid);
    }
});